/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.etop.weibo.util;

import java.util.ArrayList;
import java.util.List;
import org.apache.commons.beanutils.Converter;

/**
 *
 * @author jansing
 * lz_jansing@163.com
 */
public class ListConverter implements Converter{

    @Override
    public Object convert(Class type, Object o) {
        if(type==List.class){
            return null;
        }
        if(o instanceof String[]){
            List<String> list = new ArrayList<>();
            for(String s :(String[]) o){
                list.add(s);
            }
            return list;
        }
        return null;
    }
    

}
